package j02menthod;

public class J1 {
    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            for (int i = 0; i < 100; i++) {
                System.out.println("t1-"+i);
            }
        });
        Thread t2 = new Thread(()->{
            System.out.println("enter t2");
            try {
                t1.join();
//                t1.join(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

            for (int i = 0; i < 100; i++) {
                System.out.println("t222222-"+i);
            }
        });
//        t1.setPriority(1);
//        t2.setPriority(10);
//        System.out.println(t1.getPriority());
        t1.start();
        t2.start();
    }
}
